<script setup lang="ts">
import { RouterView, useRouter } from "vue-router";
import Menu from "@/components/Menu.vue";
import { logout } from "@/apis/user";
import { setToken } from "@/utils/store";
const router = useRouter();
const logoutFun = async () => {
  await logout();
  setToken("");
  router.replace({ name: "Login" });
};
</script>

<template>
  <el-container class="flex">
    <el-aside class="flex bg-slate-600" width="200px"><Menu></Menu></el-aside>
    <el-container>
      <el-header class="flex items-center justify-end">
        <el-button @click="logoutFun">退出</el-button>
      </el-header>
      <el-main> <RouterView /> </el-main>
    </el-container>
  </el-container>
</template>

<style scoped></style>
